﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 监控程序
{
    static class MessageboxExtension
    {
        public static Form CloseAfter(int milliseconds)
        {
            Form msg = new Form();
            Task.Run(new Action(() =>
            {
                System.Threading.Thread.Sleep(milliseconds);
                msg.Invoke(new Action(() =>
                {
                    msg.Close();
                }));
            }));
            return msg;
        }
    }
}
